<?php
function short($text, $len) {
	if (strlen($text) <= $len) return $text;
	preg_match('/^.{0,'.$len.'}(?=\\b)/', $text, $match);
	$text = rtrim($match[0]) . " ...";
	return $text;
}
